package br.com.poliwar.view {
	import br.com.poliwar.view.events.TelaMenuEvent;
	import flash.events.MouseEvent;
	/**
	 * ...
	 * @author Ricardo Teixeira
	 */
	public class TelaMenu extends MenuPrincipalSWC {
		
		public function TelaMenu() {
			this.buscar.addEventListener (MouseEvent.CLICK, onClickBuscar);
			this.criar.addEventListener (MouseEvent.CLICK, onClickCriar);
			this.ajuda.addEventListener (MouseEvent.CLICK, onClickAjuda);
			this.sair.addEventListener (MouseEvent.CLICK, onClickSair);
		}
		
		private function onClickSair(e:MouseEvent):void {
			var evento:TelaMenuEvent = new TelaMenuEvent (TelaMenuEvent.SAIR);
			this.dispatchEvent (evento);
		}
		
		private function onClickAjuda(e:MouseEvent):void {
			var evento:TelaMenuEvent = new TelaMenuEvent (TelaMenuEvent.AJUDA);
			this.dispatchEvent (evento);
		}
		
		private function onClickCriar(e:MouseEvent):void {
			var evento:TelaMenuEvent = new TelaMenuEvent (TelaMenuEvent.CRIAR_JOGO);
			this.dispatchEvent (evento);
		}
		
		private function onClickBuscar(e:MouseEvent):void {
			var evento:TelaMenuEvent = new TelaMenuEvent (TelaMenuEvent.BUSCAR_JOGO);
			this.dispatchEvent (evento);
		}
		
	}

}